package com.design.mediator.football;

/**
 * @author xiemiao
 * @description
 * @date 2023/08/17
 */
public class Player {

    private String name;

    private Referee referee;

    public Player(String name, Referee referee) {
        this.name = name;
        this.referee = referee;
    }

    public void scoreGoal() {
        System.out.println(name + "射门得分");
        referee.handleGoal(this);
    }

    public void conflictWith(Player player) {
        System.out.println(name + player.getName() + "发生冲突");
        referee.handleConflict(this, player);
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Referee getReferee() {
        return referee;
    }

    public void setReferee(Referee referee) {
        this.referee = referee;
    }
}
